package com.bigdata.es.conf;

import java.io.InputStream;
import java.util.Properties;

public class ConfigurationManager {

    private static Properties properties = new Properties();

    static{
        try{
            InputStream in = ConfigurationManager.class
                    .getClassLoader()
                    .getResourceAsStream("pro.properties");
            properties.load(in);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static String getProperty(String key) {
        return properties.getProperty(key);
    }

    public static Integer getInteger(String key) {
        String value = properties.getProperty(key);
        try{
            return Integer.valueOf(value);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }
}
